import java.util.ArrayList;
import java.util.List;

public class SudokuItem {
    private int num;    //存放该格子的数字
    private boolean canChange; //表示该格子上的数字是否能被更改
    private final int collect;    //表示该格子属于哪个小宫格
    private final List<Integer> history = new ArrayList<>();//存放已经写入过的数据

    SudokuItem(int num, boolean canChange, int collect) {
        this.num = num;
        this.canChange = canChange;
        this.collect = collect;
    }
    void addHistory(int his) {
        history.add(his);
    }
    boolean inHistory(int n) {
        return history.contains(n);
    }
    void clearHistroy() {
        this.history.clear();
    }

    public int getNum() {
        return num;
    }

    public boolean isCanChange() {
        return canChange;
    }

    public int getCollect() {
        return collect;
    }


    public void setNum(int num) {
        this.num = num;
    }

    public void setCanChange(boolean canChange) {
        this.canChange = canChange;
    }

}
